package openbang.common.vo;

/**
 * 
 * 系统支持的按钮操作类型定义 : 
 * 
 * 所有操作类型的归纳:
 *  前端跳转：新增、查询、修改、复制、存档查询
 *  数据存储：保存、删除、存档
 * @author aibo zeng
 *
 */

public enum ActionTypeEnum {
	NEWADD(100,"新增"),//空的对象
	QUERY(101,"查询"), 
	MODIFY(102,"修改"),
	COPY(103,"复制"),  //已有对象复制为新增
	QUERY_ARCHIVE(104,"查询存档"),
	
	SAVE(200,"保存"),//别名：提交、发送、确认
	DELETE(201,"删除"),
	ARCHIVE(201,"存档"),
	
	HELP(201,"帮助"),
	
	CUSTOM(9999,"用户自定义");


	private Integer code;
	private String desc;
	
	private ActionTypeEnum(Integer code,String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public String getDesc(){
		return desc;
	}
	
	public static String getDesc(Integer code) {
		for(ActionTypeEnum each : ActionTypeEnum.values()) {
			if(each.getCode()==code)
				return each.getDesc();
		}		
		return "";
	}
}
